package com.xsz.pda.data.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.xsz.pda.data.bean.TicketItem


@Dao
interface TicketItemDao {

    @Insert
    fun inertAll(ticketItemList: List<TicketItem>)

    @Query("delete from TicketItem")
    fun clear()

    @Update
    fun update(ticketItem: TicketItem)

    @Update
    fun update(ticketItems: List<TicketItem>)

    @Query("select * from ticketitem where ticketId=:id")
    fun queryByTicketId(id: String): TicketItem?

    @Query("select * from ticketitem where id=:id")
    fun getById(id: String): TicketItem?

    @Query("select timestamp from ticketitem order by timestamp desc limit 1")
    fun getLastSyncTime(): Long?

}